<?php
    if($_SESSION['vaitro']=="Quản Trị"){
        $actionlink = "../admin/ketquatimkiem.php";
    }else{
        $actionlink = "../view/ketquatimkiem.php";
    }
?>
<div class="search">
    <div >
    <form action="<?php echo $actionlink; ?>" method="post" name="frmsearch">
        <table border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td>
            <img src="../images/search_icon.png" />
            </td>
            <td>
            <input style="height:26px; width: 175px;" type="text" name="search" id="search" value="" />
            </td>

        </tr>
        </table>
    </div>
    
    <div class="danhmuctimkiem">
        <?php 
       
            if($trang=="dean"){
            
                $sql_msearch="select html from searchmenu where idsearch=1 or idsearch=2 or idsearch=3";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }
                echo"<input type='hidden' name='truonghop' value='timdean' />";
            }elseif($trang=="phongban"){
                
                $sql_msearch="select html from searchmenu where idsearch=4 or idsearch=5 or idsearch=6";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }                
                echo"<input type='hidden' name='truonghop' value='timphongban' />";
            }elseif($trang=="nhanvien"){
                
                $sql_msearch="select html from searchmenu where idsearch=7 or idsearch=8 or idsearch=9 or idsearch = 10 ";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }                   
                echo"<input type='hidden' name='truonghop' value='timnhanvien' />";
            }elseif($trang=="tinnhan"){
                
                $sql_msearch="select html from searchmenu where idsearch=13 or idsearch=14 ";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }
            }elseif($trang=="tinnhanuser"){
                
                $sql_msearch="select html from searchmenu where idsearch=13 or idsearch=14 ";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }                                                   
                echo"<input type='hidden' name='truonghop' value='timtinnhan' />";
            }elseif($trang=="thong bao"){
                
                $sql_msearch="select html from searchmenu where idsearch=15 or idsearch=16 ";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }                   
                echo"<input type='hidden' name='truonghop' value='timthongbao' />";
            }elseif($trang=="thong bao_user"){
                
                $sql_msearch="select html from searchmenu where idsearch=15 or idsearch=16 ";
                $kqmenu = executeQuery($sql_msearch);
                    while($html = mysql_fetch_array($kqmenu)){
                    echo $html['html'];                
                    }                   
                echo"<input type='hidden' name='truonghop' value='timthongbao' />";
            }
        ?>
        
               
        
        
        <input type="submit" name="searchbt" id="searchbt" value="tìm kiếm" />
    </form>   
    </div>
</div><!--end search-->